<template>
  <el-config-provider :locale="currentLocale">
    <router-view></router-view>
  </el-config-provider>
</template>

<script setup>
import { ref, watch, computed } from 'vue'
import { useI18n } from 'vue-i18n'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import { useStore } from "@/store";
import { onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";

const router = useRouter();
const route = useRoute();
const store = useStore();

const { locale } = useI18n()
const currentLocale = ref(zhCn)
// 监听语言变化
watch(
  () => locale.value,
  (val) => {
    currentLocale.value = val === 'ZhCN' ? zhCn : en
  }
)
</script>

<style scoped lang="scss">
@import "@/assets/css/base.scss";
</style>
